﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CCWin;
using CCWin.SkinControl;

namespace SafeSave
{
    public partial class TagChooseForm : CCSkinMain
    {
        public delegate void chooseTags(List<string> tags,List<string> policy);//声明一个委托

        private List<string> tags = new List<string>();
        private List<string> policy = new List<string>();

        //声明一个委托类型的事件
        public event chooseTags chooseFileTags;

        public TagChooseForm()
        {
            InitializeComponent();
        }
        
        private void confirmButton_Click(object sender, EventArgs e)
        {
            if(vipCheck.Checked)
            {
                policy.Add("VIP");
            }
            if(homeCheck.Checked)
            {
                policy.Add("家庭");
            }
            if(schoolCheck.Checked)
            {
                policy.Add("学校");
            }
            if(workCheck.Checked)
            {
                policy.Add("工作");
            }
            if(secretCheck.Checked)
            {
                policy.Add("私密");
            }
            chooseFileTags(tags,policy);
            this.Close();
        }

        private void addButton_Click(object sender, EventArgs e)
        {
            tags.Add(nowTagBox.Text);
            SkinListBoxItem temp = new SkinListBoxItem();
            temp.Text = nowTagBox.Text;
            tagsBox.Items.Add(temp);
            nowTagBox.Text = "";
        }

    }
}
